use Dosvid
go

if exists(select 1
		  from sysobjects
		  where name = 'Candidat_EMails')
  drop table Candidat_EMails
go

create table Candidat_EMails
(
  Id int identity(1,1) not null,
  CandidatID int not null,
  EMail nvarchar(255) not null
)  
go

alter table Candidat_EMails add constraint PK_Candidat_EMails_ID primary key(Id) 
go


alter table Candidat_EMails add constraint FK_Candidat_EMails_Candidates_CandidatID 
      foreign key (CandidatID) references Candidates(Id) on delete cascade
go


create nonclustered index IX_Candidat_EMails_CandidatId on Candidat_EMails
       (CandidatID asc)
go
